﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Master.master" AutoEventWireup="true" CodeFile="admindonhang.aspx.cs" Inherits="Admin_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div align="center">
        <p>
            QU&#7842;N L&Yacute; &#272;&#416;N H&Agrave;NG</p>
        <asp:Repeater ID="Repeater1" OnItemCommand="rept_ItemCommand" runat="server">
            <HeaderTemplate>
                <%--<link href="../Styles/Site.css" rel="stylesheet" type="text/css" />--%>
                <div>
                    <table class="item1" border=1>
                        <th>
                            M&atilde; DH</th>
                        <th>
                            M&atilde; KH</th>
                        <th>
                            Ng&agrave;y &#272;&#7863;tH&agrave;ng</th>
                        <th>
                            Ng&agrave;y GiaoH&agrave;ng</th>
                        <th>
                            T&ecirc;n NguoiNhan</th>
                        <th>
                            &#272;&#7883;a Ch&#7881; Nh&#7853;n</th>
                        <th>
                            &#272;i&#7879;n Tho&#7841;i</th>
                        <th>
                            HTTT</th>
                        <th>
                            HTGH</th>
                        <th>
                            Tr&#7883;Gi&aacute;</th>
                        <th>
                            &#272;&atilde;Giao</th>
                        <th>
                            X&oacute;a</th>
                        <th>
                            S&#7919;a</th>
                </div>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <asp:Label ID="lblmadh" runat="server" Text='<%#Eval("madh") %>'></asp:Label>
                        <asp:TextBox ID="txtmadh" runat="server" Text='<%#Eval("madh") %>' 
                            Visible="false"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="lblmakh" runat="server" Text='<%#Eval("makh") %>'></asp:Label>
                        <asp:TextBox ID="txtmakh" runat="server" Text='<%#Eval("makh") %>' 
                            Visible="false"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="lblngaydathang" runat="server" Text='<%#Eval("ngaydathang") %>'></asp:Label>
                        <asp:TextBox ID="txtngaydathang" Width="100px" runat="server" Text='<%#Eval("ngaydathang") %>' 
            Visible="false"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="lblngaygiaohang" runat="server" Text='<%#Eval("ngaygiaohang") %>'></asp:Label>
                        <asp:TextBox ID="txtngaygiaohang" Width="100px" runat="server" Text='<%#Eval("ngaygiaohang") %>' 
            Visible="false"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="lbltennguoinhan" runat="server" Text='<%#Eval("tennguoinhan") %>'></asp:Label>
                        <asp:TextBox ID="txttennguoinhan" runat="server" Text='<%#Eval("tennguoinhan") %>' 
                            Visible="false"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="lbldiachinhan" runat="server" Text='<%#Eval("diachinhan") %>'></asp:Label>
                        <asp:TextBox ID="txtdiachinhan" runat="server" Text='<%#Eval("diachinhan") %>' 
            Visible="false"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="lbldienthoainhan" runat="server" Text='<%#Eval("dienthoainhan") %>'></asp:Label>
                        <asp:TextBox ID="txtdienthoainhan" Width="100px"  runat="server" 
            Text='<%#Eval("dienthoainhan") %>' Visible="false"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="lblhttt" runat="server" Text='<%#Eval("httt") %>'></asp:Label>
                        <asp:TextBox ID="txthttt" runat="server" Text='<%#Eval("httt") %>' 
                            Visible="false"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="lblhtgh" runat="server" Text='<%#Eval("htgh") %>'></asp:Label>
                        <asp:TextBox ID="txthtgh" runat="server" Text='<%#Eval("htgh") %>' 
                            Visible="false"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="lbltrigia" runat="server" Text='<%#Eval("trigia") %>'></asp:Label>
                        <asp:TextBox ID="txttrigia" runat="server" Text='<%#Eval("trigia") %>' 
            Visible="false"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="lbldagiao" runat="server" Text='<%#Eval("dagiao") %>'></asp:Label>
                        <asp:TextBox ID="txtdagiao" runat="server" Text='<%#Eval("dagiao") %>' 
            Visible="false"></asp:TextBox>
                    </td>
                    <td>
                        <asp:LinkButton CommandArgument='<%#Eval("madh") %>' CommandName="Xoa" ID="Button1" 
            runat="server">X&oacute;a</asp:LinkButton>
                    </td>
                    <td>
                        <asp:LinkButton ID="LinkSua" CommandArgument='<%#Eval("madh") %>' CommandName="Sua" 
            runat="server">S&#7917;a</asp:LinkButton>
                        <asp:LinkButton ID="LinkLuu" CommandArgument='<%#Eval("madh") %>' CommandName="Luu" 
            runat="server" Visible="false">L&#432;u</asp:LinkButton>
                        <asp:LinkButton ID="LinkDung" CommandArgument='<%#Eval("madh") %>' 
            CommandName="Dung" runat="server" Visible="false">D&#7915;ng</asp:LinkButton>
                    </td>
                    <%--<td>
                        <ItemTemplate>
                            <asp:HyperLink ID="HyperLink1" runat="server" ImageUrl="~/images/chitiet.jpg" 
              NavigateUrl='<%# "~/chitietsp.aspx?masp="+ Eval("masp") %>'>HyperLink</asp:HyperLink>
                        </ItemTemplate>
                    </td>--%>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConflictDetection="CompareAllValues" 
        ConnectionString="<%$ ConnectionStrings:F:\123456\CHECKOUT LAN 1\APP_DATA\QLSHOPTT.MDFConnectionString %>" 
        DeleteCommand="DELETE FROM [SanPham] WHERE [masp] = @original_masp AND (([tensp] = @original_tensp) OR ([tensp] IS NULL AND @original_tensp IS NULL)) AND (([mota] = @original_mota) OR ([mota] IS NULL AND @original_mota IS NULL)) AND (([dongia] = @original_dongia) OR ([dongia] IS NULL AND @original_dongia IS NULL)) AND (([trangthai] = @original_trangthai) OR ([trangthai] IS NULL AND @original_trangthai IS NULL)) AND (([hinh] = @original_hinh) OR ([hinh] IS NULL AND @original_hinh IS NULL)) AND (([madm] = @original_madm) OR ([madm] IS NULL AND @original_madm IS NULL)) AND (([soluong] = @original_soluong) OR ([soluong] IS NULL AND @original_soluong IS NULL)) AND (([donvitinh] = @original_donvitinh) OR ([donvitinh] IS NULL AND @original_donvitinh IS NULL)) AND (([ngaycapnhat] = @original_ngaycapnhat) OR ([ngaycapnhat] IS NULL AND @original_ngaycapnhat IS NULL))" 
        InsertCommand="INSERT INTO [SanPham] ([tensp], [mota], [dongia], [trangthai], [hinh], [madm], [soluong], [donvitinh], [ngaycapnhat]) VALUES (@tensp, @mota, @dongia, @trangthai, @hinh, @madm, @soluong, @donvitinh, @ngaycapnhat)" 
        OldValuesParameterFormatString="original_{0}" 
        SelectCommand="SELECT * FROM [DonHang]" 
        
        
        UpdateCommand="UPDATE [SanPham] SET [tensp] = @tensp, [mota] = @mota, [dongia] = @dongia, [trangthai] = @trangthai, [hinh] = @hinh, [madm] = @madm, [soluong] = @soluong, [donvitinh] = @donvitinh, [ngaycapnhat] = @ngaycapnhat WHERE [masp] = @original_masp AND (([tensp] = @original_tensp) OR ([tensp] IS NULL AND @original_tensp IS NULL)) AND (([mota] = @original_mota) OR ([mota] IS NULL AND @original_mota IS NULL)) AND (([dongia] = @original_dongia) OR ([dongia] IS NULL AND @original_dongia IS NULL)) AND (([trangthai] = @original_trangthai) OR ([trangthai] IS NULL AND @original_trangthai IS NULL)) AND (([hinh] = @original_hinh) OR ([hinh] IS NULL AND @original_hinh IS NULL)) AND (([madm] = @original_madm) OR ([madm] IS NULL AND @original_madm IS NULL)) AND (([soluong] = @original_soluong) OR ([soluong] IS NULL AND @original_soluong IS NULL)) AND (([donvitinh] = @original_donvitinh) OR ([donvitinh] IS NULL AND @original_donvitinh IS NULL)) AND (([ngaycapnhat] = @original_ngaycapnhat) OR ([ngaycapnhat] IS NULL AND @original_ngaycapnhat IS NULL))">
        <DeleteParameters>
            <asp:Parameter Name="original_masp" Type="Int32" />
            <asp:Parameter Name="original_tensp" Type="String" />
            <asp:Parameter Name="original_mota" Type="String" />
            <asp:Parameter Name="original_dongia" Type="Int32" />
            <asp:Parameter Name="original_trangthai" Type="String" />
            <asp:Parameter Name="original_hinh" Type="String" />
            <asp:Parameter Name="original_madm" Type="Int32" />
            <asp:Parameter Name="original_soluong" Type="Int32" />
            <asp:Parameter Name="original_donvitinh" Type="String" />
            <asp:Parameter Name="original_ngaycapnhat" Type="DateTime" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="tensp" Type="String" />
            <asp:Parameter Name="mota" Type="String" />
            <asp:Parameter Name="dongia" Type="Int32" />
            <asp:Parameter Name="trangthai" Type="String" />
            <asp:Parameter Name="hinh" Type="String" />
            <asp:Parameter Name="madm" Type="Int32" />
            <asp:Parameter Name="soluong" Type="Int32" />
            <asp:Parameter Name="donvitinh" Type="String" />
            <asp:Parameter Name="ngaycapnhat" Type="DateTime" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="tensp" Type="String" />
            <asp:Parameter Name="mota" Type="String" />
            <asp:Parameter Name="dongia" Type="Int32" />
            <asp:Parameter Name="trangthai" Type="String" />
            <asp:Parameter Name="hinh" Type="String" />
            <asp:Parameter Name="madm" Type="Int32" />
            <asp:Parameter Name="soluong" Type="Int32" />
            <asp:Parameter Name="donvitinh" Type="String" />
            <asp:Parameter Name="ngaycapnhat" Type="DateTime" />
            <asp:Parameter Name="original_masp" Type="Int32" />
            <asp:Parameter Name="original_tensp" Type="String" />
            <asp:Parameter Name="original_mota" Type="String" />
            <asp:Parameter Name="original_dongia" Type="Int32" />
            <asp:Parameter Name="original_trangthai" Type="String" />
            <asp:Parameter Name="original_hinh" Type="String" />
            <asp:Parameter Name="original_madm" Type="Int32" />
            <asp:Parameter Name="original_soluong" Type="Int32" />
            <asp:Parameter Name="original_donvitinh" Type="String" />
            <asp:Parameter Name="original_ngaycapnhat" Type="DateTime" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:Label ID="lbThongBao" runat="server" Font-Bold="True" Font-Size="Medium" 
        ForeColor="#FF9933" Visible="False"></asp:Label>
</asp:Content>

